package com.huishu.order.fegin;

import com.huishu.commons.pojo.Result;
import com.huishu.commons.pojo.dto.AddIntegrationDTO;
import com.huishu.commons.pojo.model.AdminUserDO;
import com.huishu.commons.pojo.model.UserDO;
import com.huishu.commons.pojo.vo.UserMemberVO;
import com.huishu.order.fegin.fallback.UserFeignClientFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @ClassName：UserFeignClient
 * @Author: ljj
 * @Date: 2023/4/10 16:27
 * @Description:
 */
@FeignClient(name = "user-server", path = "/user", fallbackFactory = UserFeignClientFallBack.class)
public interface UserFeignClient {

    /**
     * 获取用户信息
     * @param id
     * @return
     */
    @GetMapping("/user/getUserInfo/{id}")
    Result<UserDO> getUserInfo(@PathVariable Long id);

    /**
     * 添加积分
     * @param addIntegrationDTO
     */
    @PostMapping("/user/add-integration")
    Result addIntegration(@RequestBody AddIntegrationDTO addIntegrationDTO);

    /**
     * 获取用户会员信息
     * @param userIds
     */
    @PostMapping("/user/findUserMember")
    Result<List<UserMemberVO>> findUserMember(@RequestBody List<Long> userIds);

    /**
     * 获取用户会员code
     * @param userId
     * @return
     */
    @GetMapping("/user/getUserMemberCode/{userId}")
    Result<String> getUserMemberCode(@PathVariable Long userId);

    /**
     * 获取后台人员信息
     * @param adminUid
     * @return
     */
    @GetMapping("/admin-user/getAdminUserInfo/{adminUid}")
    Result<AdminUserDO> getAdminUserInfo(@PathVariable Long adminUid);
}
